home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / comm / tcp / ATCP_src_22.lha / AmiTCP-2.2 / src / amitcp / sys / systm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-07  |  5.7 KB  |  168 lines

  1. /*
  2.  * $Id: systm.h,v 1.17 1993/11/07 00:05:41 ppessi Exp $
  3.  *
  4.  * Copyright (c) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
  5.  *                    Helsinki University of Technology, Finland.
  6.  *                    All rights reserved.
  7.  *
  8.  * HISTORY
  9.  * $Log: systm.h,v $
  10.  * Revision 1.17  1993/11/07  00:05:41  ppessi
  11.  * Added csprintf(), vsprintf() and vcsprintf() functions.
  12.  *
  13.  * Revision 1.16  1993/06/04  11:16:15  jraja
  14.  * Fixes for first public release.
  15.  *
  16.  * Revision 1.15  1993/05/17  01:02:04  ppessi
  17.  * Changed RCS version
  18.  *
  19.  * Revision 1.14  1993/04/28  13:01:01  puhuri
  20.  * Fixed stdargs.h to stdarg.h
  21.  *
  22.  * Revision 1.13  93/04/27  10:27:58  10:27:58  puhuri (Markus Peuhkuri)
  23.  * Add prototype for vlog().
  24.  * 
  25.  * Revision 1.12  93/03/12  23:57:26  23:57:26  ppessi (Pekka Pessi)
  26.  * Fixed logging function prototypes
  27.  * 
  28.  * Revision 1.11  93/03/11  17:02:13  17:02:13  jraja (Jarno Tapio Rajahalme)
  29.  * Changed back to c types, removed obsolete stuff.
  30.  * 
  31.  * Revision 1.10  93/03/10  17:16:57  17:16:57  puhuri (Markus Peuhkuri)
  32.  * Fixed function prototypes (for kern/subr_prf.c/1.12)
  33.  * 
  34.  * Revision 1.9  93/03/05  03:29:43  03:29:43  ppessi (Pekka Pessi)
  35.  * Compiles with SASC. Initial test version.
  36.  * 
  37.  * Revision 1.8  93/03/03  15:50:23  15:50:23  jraja (Jarno Tapio Rajahalme)
  38.  * Cleanup.
  39.  * 
  40.  * Revision 1.7  93/02/25  19:14:05  19:14:05  ppessi (Pekka Pessi)
  41.  *     Fixed bug with queue_node.
  42.  * 
  43.  * Revision 1.6  93/02/25  19:09:17  19:09:17  puhuri (Markus Peuhkuri)
  44.  * fixed defination of log, panic, printf and add kprintf.
  45.  * 
  46.  * Revision 1.5  93/02/24  11:16:19  11:16:19  jraja (Jarno Tapio Rajahalme)
  47.  * Changed path uxkern to kern.
  48.  * 
  49.  * Revision 1.4  93/02/04  18:22:16  18:22:16  jraja (Jarno Tapio Rajahalme)
  50.  * Cleaned up _insque and _remque definitions.
  51.  * Commented out some obsolete definitions.
  52.  * 
  53.  * Revision 1.3  93/01/06  19:16:57  19:16:57  jraja (Jarno Tapio Rajahalme)
  54.  * Added inline definitions for _insque and _remque.
  55.  * Also added #include <uxkern/amiga_subr.h> for bcmp(), bcopy() and bzero()
  56.  * definitions.
  57.  * 
  58.  * Revision 1.2  92/11/20  15:57:06  15:57:06  jraja (Jarno Tapio Rajahalme)
  59.  * Added #ifndef AMITCP's to make this compile.
  60.  * 
  61.  * Revision 1.1  92/11/20  15:48:10  15:48:10  jraja (Jarno Tapio Rajahalme)
  62.  * Initial revision
  63.  * 
  64.  */
  65.  
  66. /*-
  67.  * Copyright (c) 1982, 1988, 1991 The Regents of the University of California.
  68.  * All rights reserved.
  69.  *
  70.  * Redistribution and use in source and binary forms, with or without
  71.  * modification, are permitted provided that the following conditions
  72.  * are met:
  73.  * 1. Redistributions of source code must retain the above copyright
  74.  *    notice, this list of conditions and the following disclaimer.
  75.  * 2. Redistributions in binary form must reproduce the above copyright
  76.  *    notice, this list of conditions and the following disclaimer in the
  77.  *    documentation and/or other materials provided with the distribution.
  78.  * 3. All advertising materials mentioning features or use of this software
  79.  *    must display the following acknowledgement:
  80.  *    This product includes software developed by the University of
  81.  *    California, Berkeley and its contributors.
  82.  * 4. Neither the name of the University nor the names of its contributors
  83.  *    may be used to endorse or promote products derived from this software
  84.  *    without specific prior written permission.
  85.  *
  86.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  87.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  88.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  89.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  90.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  91.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  92.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  93.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  94.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  95.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  96.  * SUCH DAMAGE.
  97.  *
  98.  *    @(#)systm.h    7.17 (Berkeley) 5/25/91
  99.  */
  100.  
  101. #ifndef SYS_SYSTM_H
  102. #define SYS_SYSTM_H
  103.  
  104. #ifndef SYS_TYPES_H
  105. #include <sys/types.h>
  106. #endif
  107.  
  108. #ifndef SYS_CDEFS_H
  109. #include <sys/cdefs.h>        /* for the inlines */
  110. #endif
  111.  
  112. #include <stdarg.h>
  113.  
  114. /*
  115.  * queue node definition for _insque and _remque. _insque and _remque expect
  116.  * to find this structure from the start of every node they handle.
  117.  */
  118.  
  119. struct queue_node {
  120.   struct queue_node *next;
  121.   struct queue_node *prev;
  122. };
  123.  
  124. /* casts to keep lint happy */
  125. #define    insque(q,p)    _insque((struct queue_node *)q,(struct queue_node *)p)
  126.  
  127. static inline void 
  128. _insque(register struct queue_node *node, register struct queue_node *pred)
  129. {
  130.   node->next = pred->next;
  131.   node->prev = pred;
  132.   (pred->next)->prev = node;
  133.   pred->next = node;
  134. }
  135.  
  136. #define    remque(q)    _remque((struct queue_node *)q)
  137.  
  138. static inline struct queue_node *
  139. _remque(register struct queue_node *node)
  140. {
  141.   (node->next)->prev = node->prev;
  142.   (node->prev)->next = node->next;
  143.   return(node);
  144. }
  145.  
  146. /*
  147.  * General function declarations.
  148.  */
  149.  
  150. void panic(const char *, ...);
  151. void log(unsigned long, const char *, ...);
  152. void vlog(unsigned long, const char *, va_list);
  153. unsigned long printf(const char *, ...);
  154. unsigned long sprintf(char * buf, const char * fmt, ...);
  155. unsigned long csprintf(struct CSource* buf, const char * fmt, ...);
  156. unsigned long vsprintf(char * buf, const char * fmt, va_list);
  157. unsigned long vcsprintf(struct CSource* buf, const char * fmt, va_list);
  158. int  ultoa(unsigned long ul, char *buffer);
  159. int  ltoa(long l, char *buffer);
  160.  
  161. #define itoa(i,buffer) ltoa((long)i,buffer)
  162.  
  163. #ifndef AMIGA_SUBR_H
  164. #include <kern/amiga_subr.h>
  165. #endif
  166.  
  167. #endif /* !SYS_SYSTM_H */
  168.